<include file="Public/header"/>
<body class="body-bg">
<script>
    $(function () {
        var mySwiper = new Swiper('.swiper-container', {
            autoplay: 3000,
            pagination : '.swiper-pagination',
            loop: true,
            autoplayDisableOnInteraction: false
        });
    });
</script>
<div class="park-header">
    <div class="park-header__title">鲜乐园生鲜市场</div>
    <div class="park-header__right" onclick="window.location='/Home/Index/search/';">
        <i class="iconfont icon-search"></i>
    </div>
</div>
<form id="pay" action="http://tqr.frontpay.cn/sinochem/order/comfirmpay?token={$token}" method="post">
    <!--<input type="hidden" name="Token" value="{$token}">-->
</form>
<div class="container mb-footer">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <volist name="ad_list" id="val">
                <div class="swiper-slide">
                    <div class="swiper-pic">
                        <a href="{$val.ad_link}">
                            <img src="{$val.ad_code}" width="100%">
                        </a>
                    </div>
                </div>
            </volist>
        </div>
        <div class="swiper-pagination"></div>
    </div>
    <div class="park-goods-index">
        <div class="park-goods-index__group" <if condition="$purchase['id'] eq ''">style="display:none;"</if>>
            <div class="park-goods-index__title">
                <div class="left"><i class="iconfont icon-time park-red"></i>&nbsp;<span class="park-red">限时抢购</span></div>
                <div class="right" onclick="window.location='/Home/Index/purchase';"><span>更多</span><i class="iconfont icon-gengduo"></i></div>
            </div>
            <div class="park-goods-top" onclick="goods_detail({$purchase['goods_id']},{$purchase['store_id']});">
                <div class="park-goods-top__info">
                    <div class="countDown-pos">
                        <div id="countDown" class="park__countDown"><span class="hour" id="time02">00</span>:<span class="minute" id="time03">00</span>:<span class="second" id="time04">00</span></div>
                    </div>
                    <p class="name">{$purchase.goods_name}</p>
                    <p class="desc">{$purchase.store_name}</p>
                    <p class="line"></p>
                    <p class="price">￥<span>{$purchase.spec_price}</span></p>
                    <p class="Oprice park-line-through">￥<span>{$purchase.spec_mk_price}</span></p>
                    <p class="number">剩余：{$purchase['use_number']-$purchase['mall_number']}份</p>
                </div>
                <div class="park-goods-top__pic" style="background-image: url('{$purchase.thumb}')"></div>
            </div>
        </div>
        <div class="park-goods-index__group">
            <div class="park-goods-index__title">
                <div class="left"><i class="iconfont icon-new park-blue"></i>&nbsp;<span class="park-blue">新品速递</span></div>
                <div class="right" onclick="window.location='/Home/Index/new_goods/type/1';"><span>更多</span><i class="iconfont icon-gengduo"></i></div>
            </div>
            <div class="park-goods-top park-goods-tops">
                <div class="park-goods-top__pic" style="background-image: url({$new_list[0]['thumb']})"></div>
                <div class="park-goods-top__info">
                    <p class="name">{$new_list[0]['goods_name']}</p>
                    <p class="desc" style="overflow:hidden;">{$new_list[0]['keywords']}</p>
                    <p class="line"></p>
                    <p class="price">￥<span>{$new_list[0]['shop_price']}</span></p>
                    <p class="Oprice">原价：￥{$new_list[0]['mk_price']}</p>
                </div>
                <div class="park-store-fixed">
                    <p class="title">请选择店铺</p>
                    <ul>
                        <volist name="new_list[0]['store_list']" id="vo">
                            <li onclick="goods_detail({$new_list[0]['id']},'{$vo.id}')"><a>{$vo.store_name}</a></li>
                        </volist>
                    </ul>
                </div>
            </div>
            <div class="park-goods-index-list">
                <volist name="new_list" id="val" offset="1" length="6">
                    <div class="park-goods-index-item">
                        <div class="pic" style="background-image: url({$val.thumb})"></div>
                        <p class="name">{$val.goods_name}</p>
                        <p class="price">￥<span>{:intval($val['shop_price'])}</span>{:substr($val['shop_price'],-3,3)}</p>
                        <div class="park-store-fixed">
                       		<p class="title">请选择店铺</p>
                            <ul>
                                <volist name="val['store_list']" id="vo">
                                    <li onclick="goods_detail('{$val.id}','{$vo.id}')"><a>{$vo.store_name}</a></li>
                                </volist>
                            </ul>
                        </div>
                    </div>
                </volist>
            </div>
        </div>
        <div class="park-goods-index__group">
            <div class="park-goods-index__title">
                <div class="left"><i class="iconfont icon-hot park-orange"></i>&nbsp;<span class="park-orange">热卖推荐</span></div>
                <div class="right" onclick="window.location='/Home/Index/new_goods/type/2';"><span>更多</span><i class="iconfont icon-gengduo"></i></div>
            </div>
            <div class="park-goods-top park-goods-tops">
                <div class="park-goods-top__info">
                    <p class="name">{$hot_list[0]['goods_name']}</p>
                    <p class="desc" style="overflow:hidden;">{$hot_list[0]['keywords']}</p>
                    <p class="line"></p>
                    <p class="price">￥<span>{$hot_list[0]['shop_price']}</span></p>
                    <p class="Oprice">原价：￥{$hot_list[0]['mk_price']}</p>
                </div>
                <div class="park-goods-top__pic" style="background-image: url({$hot_list[0]['thumb']})"></div>
                <div class="park-store-fixed">
                    <p class="title">请选择店铺</p>
                    <ul>
                        <volist name="hot_list[0]['store_list']" id="vo">
                            <li onclick="goods_detail({$hot_list[0]['id']},'{$vo.id}')"><a>{$vo.store_name}</a></li>
                        </volist>
                    </ul>
                </div>
            </div>
            <div class="park-goods-index-list">
                <volist name="hot_list" id="val" offset="1" length="6">
                    <div class="park-goods-index-item">
                        <div class="pic" style="background-image: url({$val.thumb})"></div>
                        <p class="name">{$val.goods_name}</p>
                        <p class="price">￥<span>{:intval($val['shop_price'])}</span>{:substr($val['shop_price'],-3,3)}</p>
                        <div class="park-store-fixed">
                            <p class="title">请选择店铺</p>
                            <ul>
                                <volist name="val['store_list']" id="vo">
                                    <li onclick="goods_detail('{$val.id}','{$vo.id}')"><a>{$vo.store_name}</a></li>
                                </volist>
                            </ul>
                        </div>
                    </div>
                </volist>
            </div>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<div class="park-mask"></div>
<script src="__ROOT__/Public/Home/js/CountDown.js"></script>
<script>
    $(function () {
        let endTime = 1498802392177 / 1000;
        new CountDown($('#countDown'), endTime);
        $(document).on('click', '.park-goods-index-item', function () {
            var store = $(this).find('.park-store-fixed').show();
            PARK.showMask();
        });
        $(document).on('click', '.park-goods-tops', function () {
            var store = $(this).find('.park-store-fixed').show();
            PARK.showMask();
        });
        $(document).on('click', '.park-mask', function () {
            $('.park-store-fixed').hide();
        });
        setInterval(GetRTime,1000);
    });
    function goods_detail(id,store_id){
        window.location = "{:U('Home/Index/detail',"",false)}/id/"+id+'/store_id/'+store_id;
    }
    function GetRTime(){
        var EndTime= new Date('{$purchase["end_time"]}');
        var NowTime = new Date();
        var t =EndTime.getTime() - NowTime.getTime();
        var d=0;
        var h=0;
        var m=0;
        var s=0;
        if(t>=0){
            d=Math.floor(t/1000/60/60/24);
            h=Math.floor(t/1000/60/60%24);
            m=Math.floor(t/1000/60%60);
            s=Math.floor(t/1000%60);
        }
        if(d>0){
            h=d*24+h;
        }
        if(h<10){
            h='0'+h;
        }
        if(m<10){
            m='0'+m;
        }
        if(s<10){
            s='0'+s;
        }
        $('#time02').html(h);
        $('#time03').html(m);
        $('#time04').html(s);
    }
    GetRTime();
	console.dir('{$token}');
    //$('#pay').submit();
</script>
</body>
</html>